package com.zerotwo.exam.center.model;

import com.zerotwo.exam.center.enums.QuestionTypeEnum;
import com.zerotwo.exam.user.model.UserAuthInfo;
import lombok.Data;

import java.util.Map;


/**
 * @author 02
 * @version 1.0
 * @Date 2024/7/5
 * @Description 考试结果统计
 */
@Data
public class ExamResultStatistic {
    float averageScore=0F;
    MostScoreInfo maxScoreInfo;
    MostScoreInfo minScoreInfo;
    Map<String ,AnswerStatisticInfo> questionStatistic;
    Map<QuestionTypeEnum,AnswerStatisticInfo> questionTypeStatistic;

    @Data
    public static class MostScoreInfo{
        float score=0;
        UserAuthInfo user;
    }
    @Data
    public static class AnswerStatisticInfo{
        int totalNumber=0;
        int correctNumber=0;

        public void autoAddCorrectNumber(){
            correctNumber++;
        }
        public void autoAddTotalNumber(){
            totalNumber++;
        }

    }
}

